package com.powernode.listener;

import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

/**
 * 延迟队列消费者
 * @author jiaxXM
 * @date 2024/7/9
 */
@Component
@RocketMQMessageListener(topic = "bootDelayMsTopic",consumerGroup = "boot-test-consumer-group")
public class DelayMsgListener implements RocketMQListener<String> {
    @Override
    public void onMessage(String message) {
        System.out.println(LocalDateTime.now());
        System.out.println("收到延迟队列消息："+message);
    }
}
